#define _CRT_SECURE_NO_WARNINGS

#include "Queue.h"
#include "Stack.h"

StackTest()
{
	Stack sk;
	StackInit(&sk);

	StackPush(&sk, 1);
	StackPush(&sk, 2);
	StackPush(&sk, 3);
	StackPush(&sk, 4);
	StackPush(&sk, 5);
	StackPush(&sk, 6);
	StackPush(&sk, 7);
	StackPrint(&sk);

	StackPop(&sk);
	StackPrint(&sk);
	StackPop(&sk);
	StackPrint(&sk);
	StackPop(&sk);
	StackPrint(&sk);
	StackPop(&sk);
	StackPrint(&sk);
	StackPop(&sk);
	StackPrint(&sk);
	StackPop(&sk);
	StackPrint(&sk);

	printf("%d\n", StackTop(&sk));
	printf("%d\n", StackSize(&sk));

	StackDestroy(&sk);
}

QueueTest()
{
	Queue qs;
	QueueInit(&qs);
	QueuePush(&qs, 1);
	QueuePush(&qs, 2);
	QueuePush(&qs, 3);
	QueuePush(&qs, 4);
	QueuePush(&qs, 5);
	QueuePush(&qs, 6);
	QueuePrint(&qs);

	printf("%d\n", QueueSize(&qs));
	printf("%d\n", QueueBack(&qs));
	printf("%d\n", QueueFront(&qs));

	QueuePop(&qs);
	QueuePrint(&qs);
	QueuePop(&qs);
	QueuePrint(&qs);
	QueuePop(&qs);
	QueuePrint(&qs);
	QueuePop(&qs);
	QueuePrint(&qs);
	QueuePop(&qs);
	QueuePrint(&qs);
	QueuePop(&qs);
	QueuePrint(&qs);

	QueueDestroy(&qs);
}

int main()
{
	StackTest();
	printf("\n");
	QueueTest();

	return 0;
}